﻿using System;
using System.Collections.Generic;
using System.Text;

namespace FastUtil.Convert
{
    public class ValueConvert
    {
        public static string ConvertToString(object Input)
        {
            string result = string.Empty;
            try
            {
                result = System.Convert.ToString(Input);
            }
            catch (Exception e)
            {

            }
            return result;
        }

        public static int ConvertToInt32(object Input)
        {
            int result = 0;
            try
            {
                result = System.Convert.ToInt32(Input);
            }
            catch (Exception e)
            {

            }
            return result;
        }

        public static double ConvertToDouble(object Input)
        {
            double result = 0;
            try
            {
                result = System.Convert.ToDouble(Input);
            }
            catch (Exception e)
            {

            }
            return result;
        }

        public static decimal ConvertToDecimal(object Input)
        {
            decimal result = 0;
            try
            {
                result = System.Convert.ToDecimal(Input);
            }
            catch (Exception e)
            {

            }
            return result;
        }

        public static DateTime ConvertToDateTime(object Input)
        {
            DateTime result = DateTime.MinValue;
            try
            {
                result = System.Convert.ToDateTime(Input);
            }
            catch (Exception e)
            {

            }
            return result;
        }

        public static bool ConvertToBoolean(object Input)
        {
            bool result = false;
            try
            {
                result = System.Convert.ToBoolean(Input);
            }
            catch (Exception e)
            {

            }
            return result;
        }
    }
}
